#ifndef __AD_H
#define __AD_H

#include "stm32f10x.h"

#define ADC_CPIO_PROT    GPIOC
#define ADC_GPIO_PINS    (GPIO_Pin_0 | GPIO_Pin_1)
#define ADC_GPIO_CLK     RCC_APB2Periph_GPIOC

#define ADC              ADC1
#define ADC_CLK          RCC_APB2Periph_ADC1
#define ADC_CHANNEL0     ADC_Channel_10
#define ADC_CHANNEL1     ADC_Channel_11
#define ADC_CHANNEL_NUM  2

#define DMA_CLK          RCC_AHBPeriph_DMA1
#define DMA_CHANNEL      DMA1_Channel1
#define DMA_BUFFERSIZE   2
#define DMA_FLAG_TC      DMA1_FLAG_TC1

extern uint16_t ad_value[ADC_CHANNEL_NUM];

void AD_Init(void);

#endif // !__AD_H